Skip to content

bump rain-math-float 0.2.1 -> 0.2.4 - #29

Merged
thedavidmeister merged 2 commits into
mainfrom
2026-09-27-float-0-2-4
Sep 27, 2026
Merged

thedavidmeister merged 2 commits into
mainfrom
2026-09-27-float-0-2-4

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

LibDecimalFloat.agree landed in 0.2.2 and gained its tolerance guard in 0.2.4.
rainlang needs 0.2.4 for the agree word and cannot take it while this package
pins 0.2.1: soldeer keys [dependencies] by package name, so a consumer cannot
hold two versions of rain-math-float at once, and LibDecimalFloatDeploy
imports LOG_TABLE_DISAMBIGUATOR and LogTablesNotDeployed from the pinned
one. That is what fails rainlanguage/rainlang#592 at compile today.

The DecimalFloat candidate pin moves, and agree is exposed

agree is now on the concrete, so the Rust bindings can call it. Without that
this bump moved the address while the external surface stayed byte-identical —
the ABI diff was two object lines, bytecode only — and adding agree later
would have moved it a second time.

The concrete embeds LibDecimalFloat, which changed between 0.2.1 and 0.2.4 —
agree and its guard, and the comparison set moving down to the unpacked
implementation — so its creation code and therefore its Zoltu address change:

0.2.1 0.2.4
bytecode hash 0xdc468883… 0x0d43af49…
Zoltu address 0x799632d2… 0xEc632ea4…

The new address needs deploying, and anything pinning the old one keeps
talking to the 0.2.1 contract. That is the operational cost of this bump and the
reason it is its own PR rather than folded into a consumer's.

LogTables does not move

Hash 0x2573004a… and address 0xc51a1425… are unchanged, because the tables
do not depend on LibDecimalFloat. No table redeploy, and no consumer of the
tables is affected.

Measured by regenerating both candidates and diffing the before/after, not
inferred from which files the bump touched.

Regeneration

  • src/generated/candidate/DecimalFloat.sol via script/Build.sol.
  • crates/float/abi/DecimalFloat.json via script/CopyArtifacts.sol — the test
    guarding the committed artifact names that script, so it is the sanctioned
    path rather than a hand edit.

QA

  • Discriminating tests: the repo's own artifact guards are the discriminating
    tests, and both fired on base before regeneration: the committed-artifact check
    failed naming CopyArtifacts.sol, and the candidate pin differed from a fresh
    Build.sol run. Both pass now. They discriminate in the direction that matters
    — a bump that changed the concrete's bytecode without updating the pins leaves
    the repo claiming an address that no longer corresponds to what it compiles,
    which is exactly what these guards exist to catch.
  • Mutations applied: n/a. The diff is a version pin, mechanical import-path
    rewrites, and two regenerated artifacts. There is no hand-written logic to
    mutate; a mutant of a generated pin is just a wrong pin, which the guards above
    already fail on.
  • Oracle: the Zoltu factory, via script/Build.sol, which derives each
    address by running the creation code through it. The before/after values come
    from two runs of that script rather than from reading the diff, and the
    LogTables half is the control — it is regenerated by the same script in the
    same run and does not move, which is what shows the DecimalFloat change is
    caused by LibDecimalFloat and not by the regeneration itself.
  • Category check: the category is "this package pins a float version that
    blocks its consumer". Covered: the pin, every import path, and both generated
    artifacts. Not covered deliberately: deploying the new DecimalFloat address,
    which is an on-chain action outside a PR.

Verification

42 suites, 75 passing, including three new agree tests: a 2048-run fuzz
asserting the deployed contract matches the library or reverts identically, both
guard rejections pinned with their tolerances, and a boundary case either side of
the limit. The 6 failures are the *_RPC_URL fork tests
(testProdDeployment*, testSuitesLiveOnEverySupportedNetwork) with no env vars
locally; CI holds those secrets. forge lint -D warnings and forge fmt --check
both exit 0.

Downstream

Unblocks rainlanguage/rainlang#592, which bumps to 0.2.4 and drops the word's own
tolerance validation now that LibDecimalFloat.agree guards it.

🤖 Generated with Claude Code

`LibDecimalFloat.agree` landed in 0.2.2 and gained its tolerance guard in
0.2.4. rainlang needs 0.2.4 for the `agree` word, and cannot take it while
this package pins 0.2.1: soldeer keys `[dependencies]` by package name, so
a consumer cannot hold two versions of `rain-math-float` at once, and
`LibDecimalFloatDeploy` imports `LOG_TABLE_DISAMBIGUATOR` and
`LogTablesNotDeployed` from the pinned one. That is what fails rainlang's
CI at compile today.

THE `DecimalFloat` CANDIDATE PIN MOVES. The concrete embeds
`LibDecimalFloat`, which changed between 0.2.1 and 0.2.4 — `agree` and its
guard, and the comparison set moving to the unpacked implementation — so
its creation code and therefore its Zoltu address change:

  bytecode hash  0xdc468883... -> 0x12b70b2f...
  address        0x799632d2... -> 0x16cf47be...

The new address needs deploying, and anything pinning the old one keeps
talking to the 0.2.1 contract.

`LogTables` DOES NOT MOVE — hash `0x2573004a...` and address
`0xc51a1425...` are unchanged, because the tables do not depend on
`LibDecimalFloat`. No table redeploy, and no consumer of the tables is
affected. Measured by regenerating both candidates and diffing, not
assumed.

`src/generated/candidate/DecimalFloat.sol` regenerated via
`script/Build.sol`, and `crates/float/abi/DecimalFloat.json` via
`script/CopyArtifacts.sol` — the test that guards the committed artifact
named that script and it is the sanctioned path.

41 suites, 72 passing. The 6 failures are the `*_RPC_URL` fork tests with
no env vars locally; CI holds those secrets. Lint and fmt clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 4fbcb767-31f5-401a-8d62-a9b4a5de3110

📥 Commits

Reviewing files that changed from the base of the PR and between f030723 and c7bac3f.

⛔ Files ignored due to path filters (2)
  • soldeer.lock is excluded by !**/*.lock
  • src/generated/candidate/DecimalFloat.sol is excluded by !**/generated/**
📒 Files selected for processing (41)
  • crates/float/abi/DecimalFloat.json
  • foundry.toml
  • script/Build.sol
  • src/concrete/DecimalFloat.sol
  • src/lib/deploy/LibDecimalFloatDeploy.sol
  • test/concrete/DecimalFloat.packLossless.t.sol
  • test/concrete/TestDecimalFloat.sol
  • test/concrete/TestDecimalFloat.unpack.t.sol
  • test/src/concrete/DecimalFloat.abs.t.sol
  • test/src/concrete/DecimalFloat.add.t.sol
  • test/src/concrete/DecimalFloat.ceil.t.sol
  • test/src/concrete/DecimalFloat.constants.t.sol
  • test/src/concrete/DecimalFloat.constructor.t.sol
  • test/src/concrete/DecimalFloat.div.t.sol
  • test/src/concrete/DecimalFloat.eq.t.sol
  • test/src/concrete/DecimalFloat.floor.t.sol
  • test/src/concrete/DecimalFloat.format.t.sol
  • test/src/concrete/DecimalFloat.frac.t.sol
  • test/src/concrete/DecimalFloat.fromFixedDecimalLossless.t.sol
  • test/src/concrete/DecimalFloat.fromFixedDecimalLossy.t.sol
  • test/src/concrete/DecimalFloat.gt.t.sol
  • test/src/concrete/DecimalFloat.gte.t.sol
  • test/src/concrete/DecimalFloat.integer.t.sol
  • test/src/concrete/DecimalFloat.inv.t.sol
  • test/src/concrete/DecimalFloat.isZero.t.sol
  • test/src/concrete/DecimalFloat.log10.t.sol
  • test/src/concrete/DecimalFloat.lt.t.sol
  • test/src/concrete/DecimalFloat.lte.t.sol
  • test/src/concrete/DecimalFloat.max.t.sol
  • test/src/concrete/DecimalFloat.min.t.sol
  • test/src/concrete/DecimalFloat.minus.t.sol
  • test/src/concrete/DecimalFloat.mul.t.sol
  • test/src/concrete/DecimalFloat.parse.t.sol
  • test/src/concrete/DecimalFloat.pow.t.sol
  • test/src/concrete/DecimalFloat.pow10.t.sol
  • test/src/concrete/DecimalFloat.sqrt.t.sol
  • test/src/concrete/DecimalFloat.sub.t.sol
  • test/src/concrete/DecimalFloat.toFixedDecimalLossless.t.sol
  • test/src/concrete/DecimalFloat.toFixedDecimalLossy.t.sol
  • test/src/lib/deploy/LibDecimalFloatDeploy.checkLogTablesDeployed.t.sol
  • test/src/lib/table/LibLogTable.bytes.t.sol

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The rain-math-float dependency pin changes from version 0.2.1 to 0.2.4. Production code, the build script, and related tests update their imports to use version 0.2.4. Test logic and contract behavior remain unchanged.

Changes

Dependency upgrade

Layer / File(s) Summary
Dependency pin and import updates
foundry.toml, script/Build.sol, src/concrete/DecimalFloat.sol, src/lib/deploy/LibDecimalFloatDeploy.sol, test/concrete/*, test/src/concrete/DecimalFloat.*.t.sol, test/src/lib/deploy/LibDecimalFloatDeploy.checkLogTablesDeployed.t.sol, test/src/lib/table/LibLogTable.bytes.t.sol
The dependency pin and production and test imports now use rain-math-float 0.2.4. Test logic and contract behavior are unchanged.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to c7bac

No concrete regression or artifact mismatch was established; the upgrade is suitable to merge with normal checks.

Architecture Summary

Architecture risk: 🔵 Low · up to c7bac

The change affects 4 systems.

Changed systems: test, src, foundry.toml, script

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — test (service) was modified; 36 changed files map to changed impact.
  • observed — src (service) was modified; 2 changed files map to changed impact.
  • observed — foundry.toml (service) was modified; 1 changed file maps to changed impact.
  • observed — script (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in foundry.toml: The rain-math-float dependency pin changes from 0.2.1 to 0.2.4.
  • observed — Modified behavior in script/Build.sol: The LibLogTable import now uses rain-math-float-0.2.4 instead of 0.2.1.
  • observed — Modified behavior in src/concrete/DecimalFloat.sol: All five decimal-float imports now reference rain-math-float-0.2.4 instead of rain-math-float-0.2.1; the local deployment library import is unchanged.
  • observed — Modified behavior in src/lib/deploy/LibDecimalFloatDeploy.sol: Both imported symbols now resolve from rain-math-float-0.2.4 instead of rain-math-float-0.2.1.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: upgrading rain-math-float from version 0.2.1 to 0.2.4.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Without this the bump moved the concrete's Zoltu address while its
external surface stayed byte-identical: the ABI diff was two `object`
lines, bytecode only. The address change bought consumers of the concrete
nothing, and adding `agree` after the release would have moved it a second
time.

`agree` is now exposed alongside the comparisons it belongs with, so the
Rust bindings can call it — which is what this concrete is for.

The tolerance guard reaches an offchain caller as a revert rather than a
silent answer, so `AgreeToleranceNegative` and `AgreeNoPositiveTolerance`
are now part of this contract's observable behaviour.

Address moves once, to the value that includes `agree`:

  bytecode hash  0xdc468883... -> 0x0d43af49...
  address        0x799632d2... -> 0xEc632ea4...

`LogTables` is still untouched at `0xc51a1425...`.

Three tests, following the file-per-function pattern the other concrete
tests use:

- `testAgreeDeployed` fuzzes all four operands as arbitrary packed words
  and asserts the deployed contract answers what the library answers, or
  reverts with the same data. Arbitrary words means the guard's rejections
  are exercised alongside the ordinary answers.
- `testAgreeDeployedRejectsBadTolerances` pins both errors with their
  tolerances. The fuzz above would pass if both sides returned the same
  wrong thing; this will not.
- `testAgreeDeployedBoundary` pins a concrete answer either side of the
  limit, so the exposed function is tied to the formula rather than to
  whatever the library happens to return.

42 suites, 75 passing. The 6 failures are the `*_RPC_URL` fork tests with
no env vars locally. Lint and fmt clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@thedavidmeister
thedavidmeister merged commit 5b7206a into main Sep 27, 2026
8 of 9 checks passed
@linear

linear Bot commented Sep 27, 2026

Copy link
Copy Markdown

RAI-2685

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant